package com.qcby.types.exception;




/**
 * 全局错误码枚举
 * 0-999 系统异常编码保留
 * <p>
 * 一般情况下，使用 HTTP 响应状态码 https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Status
 * 虽然说，HTTP 响应状态码作为业务使用表达能力偏弱，但是使用在系统层面还是非常不错的
 * 比较特殊的是，因为之前一直使用 0 作为成功，就不使用 200 啦。
 *
 * @author: cong.zhen
 * @date: 2022/11/09
 */
public interface GlobalErrorCodeConstants {
    BusinessException.ExceptionResponse SUCCESS = new BusinessException.ExceptionResponse("200", "成功");

    // ========== 客户端错误段 ==========
    BusinessException.ExceptionResponse BAD_REQUEST = new BusinessException.ExceptionResponse("400", "请求参数不正确");
    BusinessException.ExceptionResponse UNAUTHORIZED = new BusinessException.ExceptionResponse("401", "账号未登录");
    BusinessException.ExceptionResponse FORBIDDEN = new BusinessException.ExceptionResponse("403", "没有该操作权限");
    BusinessException.ExceptionResponse NOT_FOUND = new BusinessException.ExceptionResponse("404", "请求未找到");
    BusinessException.ExceptionResponse METHOD_NOT_ALLOWED = new BusinessException.ExceptionResponse("405", "请求方法不正确");
    BusinessException.ExceptionResponse LOCKED = new BusinessException.ExceptionResponse("423", "请求失败，请稍后重试");
    BusinessException.ExceptionResponse TOO_MANY_REQUESTS = new BusinessException.ExceptionResponse("429", "请求过于频繁，请稍后重试");

    // ========== 服务端错误段 ==========

    BusinessException.ExceptionResponse INTERNAL_SERVER_ERROR = new BusinessException.ExceptionResponse("500", "系统异常");
    //
    BusinessException.ExceptionResponse NO_FLOW = new BusinessException.ExceptionResponse("510","截止到今天凌晨一周内没有流量");

    // ========== 自定义错误段 ==========
    BusinessException.ExceptionResponse REPEATED_REQUESTS = new BusinessException.ExceptionResponse("900", "重复请求，请稍后重试");
    BusinessException.ExceptionResponse DEMO_DENY = new BusinessException.ExceptionResponse("901", "演示模式，禁止写操作");

    BusinessException.ExceptionResponse UTIL_EXCEPTION = new BusinessException.ExceptionResponse("902", "工具类发生异常");

    BusinessException.ExceptionResponse IDEMPOTENT_EXCEPTION = new BusinessException.ExceptionResponse("903", "幂等性校验错误");

    BusinessException.ExceptionResponse OPERATE_LOG_EXCEPTION = new BusinessException.ExceptionResponse("904", "业务日志出现错误");

    BusinessException.ExceptionResponse NACOS_EXCEPTION = new BusinessException.ExceptionResponse("906", "NACOS查询异常");

    // ================ 登录相关 ===================
    BusinessException.ExceptionResponse CAPTCHA_EXCEPTION = new BusinessException.ExceptionResponse("907", "请输入正确的图形验证码!");
    BusinessException.ExceptionResponse PASSWORD_ERROR = new BusinessException.ExceptionResponse("908", "账号或密码错误");
    BusinessException.ExceptionResponse CAPTCHA_TIMEOUT = new BusinessException.ExceptionResponse("909", "请刷新图形验证码!");
    BusinessException.ExceptionResponse USER_NOT_EXIXT = new BusinessException.ExceptionResponse("910", "用户不存在");
    BusinessException.ExceptionResponse USER_BANNED = new BusinessException.ExceptionResponse("911", "用户已被封禁，请稍后再试");




    BusinessException.ExceptionResponse UNKNOWN = new BusinessException.ExceptionResponse("999", "未知错误");



}
